﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="FollowUp.aspx.cs" Inherits="VSM.FollowUp" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function openMultiItemDialog() {
            var tabid = '<%= Request.QueryString["requestType"] %> ';
            javascript: Main.openCustomDialog('../../ItemPopup.aspx?ItemCategory=' + '102', 600, 610, "");
        }

        function openCustomer() {
            var url = "Popup_Customer.aspx?CustomerCode=S";
            Main.openCustomDialog(url, 650, 410);
        }

        function openVehicle() {
            var url = "Popup_Vehice.aspx?VehicleCode=S";
            Main.openCustomDialog(url, 650, 410);
        }

        function disablePopup(sender, evt) {

            var charCode = (evt.which) ? evt.which : event.keyCode;
            if (charCode == 13)
                return true;

            return true;
        }

        function openReservation(ServiceID) {
            var url = "P_Reservation.aspx?GeneralID=" + ServiceID;
            Main.openCustomDialog(url, 950, 700);
        }

        function openServiceHistory() {
            window.location.href = "ServiceHistory.aspx";
        }

        function openRepairOrder(ServiceID) {
            var url = "P_JobCard.aspx?GeneralID=" + ServiceID;
            Main.openCustomDialog(url, 950, 600);
        }
    </script>
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:HiddenField ID="DealerCode" runat="server" />
                <h2>
                    Follow Up</h2>
                <div style="margin-left: 5px; width: 99%;">
                    <hr />
                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <tr>
                            <td class="FormLineItemAlt" style="width: 15%">
                                Number Of Day:
                            </td>
                            <td class="FormLineItemAlt" style="width: 35%">
                                <asp:DropDownList ID="ddlDay" runat="server" Width="40%">
                                </asp:DropDownList>
                                Status:<asp:DropDownList ID="ddlStatus" runat="server" Width="38%">
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItemAlt" style="width: 10%">
                            </td>
                            <td class="FormLineItemAlt" style="width: 35%">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItemAlt" style="width: 15%">
                                Adviser:
                            </td>
                            <td class="FormLineItemAlt" style="width: 35%">
                                <asp:DropDownList ID="ddlAdviser" runat="server" Width="90%">
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItemAlt" style="width: 10%">
                            </td>
                            <td class="FormLineItemAlt" style="width: 35%">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <tr>
                            <td class="FormLineItemAlt">
                                <asp:Button ID="btn_Filter" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                    Height="30px" Text="Filter" Width="100px" OnClick="btn_Filter_Click" />
                                <asp:Button ID="Done" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF" 
                                    Height="30px" OnClick="btn_Done_Click" Text="Done" Width="100px" />
                            </td>
                        </tr>
                    </table>
                    <%--<table border="0" width="100%" style="background-color: #D1D4D8;">    CssClass="GridInner"  --%>
                    <%-- </table>--%>
                </div>
                <div style="width: 100%; height: 400px; overflow: scroll">
                    <asp:GridView ID="grvPO" runat="server" BorderColor="White" Width="1800px" BackColor="White"
                        AllowSorting="True" AutoGenerateColumns="False" CellPadding="2" HeaderStyle-Height="27px"
                        CellSpacing="2" HeaderStyle-VerticalAlign="Middle" AllowPaging="True">
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                        <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                        <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                        <Columns>
                            <%--                               <asp:CommandField HeaderText="Action" ShowDeleteButton="True" ShowEditButton="False"
                                    Visible="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    ItemStyle-Width="10px" />--%>
                            <asp:TemplateField HeaderText="Action">
                                <ItemStyle HorizontalAlign="Center" Width="220px" />
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemTemplate>
                                    <asp:Button ID="btnAppointment" runat="server" Text="Reservation" BackColor="#1B7FC2"
                                        ForeColor="#FFFFFF" OnClientClick='<%#"openReservation(\"" +Eval("GeneralID") +"\");" %>' />
                                        <asp:Button ID="btnViewRO" runat="server" Text="RO" Width="60px" BackColor="#1B7FC2"
                                        ForeColor="#FFFFFF" OnClientClick='<%#"openRepairOrder(\"" +Eval("GeneralID") +"\");" %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="#">
                                <ItemStyle HorizontalAlign="Center" Width="30px" />
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemTemplate>
                                    <asp:Label ID="lblNo" runat="server" Text='<%# Bind("RowNum") %>' BorderStyle="none">
                                    </asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="General ID">
                                <ItemStyle HorizontalAlign="Left" Width="50px" />
                                <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                <ItemTemplate>
                                    <asp:Label ID="lbGeneralID" runat="server" Text='<%# Bind("GeneralID") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Job ID">
                                <ItemStyle HorizontalAlign="Left" Width="100px" />
                                <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                <ItemTemplate>
                                    <asp:Label ID="lbJobID" runat="server" Text='<%# Bind("JobID") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Latest Service Date">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbDate" Style="text-align: left" runat="server" Text='<%# Bind("ServiceDate","{0:dd/MM/yyyy}") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="VIN">
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbVIN" runat="server" Width="97%" Text='<%# Bind("VIN") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Vehicle Name">
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbVehicleName" runat="server" Width="97%" Text='<%# Bind("VehicleName") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Reg. No.">
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" Width="70px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbRegNo" runat="server" Width="97%" Text='<%# Bind("RegNo") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Customer Name">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle VerticalAlign="Middle" Width="160px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbCustomer" Style="text-align: left" runat="server" Text='<%# Bind("CustomerName") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Phone">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbTel" Style="text-align: left" runat="server" Text='<%# Bind("Tel") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Mobi">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbMobile" Style="text-align: left" runat="server" Text='<%# Bind("Mobile") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contact Person">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbContactPerson" Style="text-align: left" runat="server" Text='<%# Bind("ContactPerson") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contact Phone">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbContactPhone" Style="text-align: left" runat="server" Text='<%# Bind("ContactPhone") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Adviser">
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" Width="130px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbAdvi" runat="server" Width="97%" Text='<%# Bind("AdviserName") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Receptionist">
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" Width="130px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbReceptionist" runat="server" Width="97%" Text='<%# Bind("Receptionist") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Address">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle VerticalAlign="Middle" Width="230px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbAddress" Style="text-align: left" runat="server" Text='<%# Bind("Address") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Customer Response">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle VerticalAlign="Middle" Width="230px" />
                                <ItemTemplate>
                                    <asp:TextBox ID="txtCustomerRes" Style="text-align: left" Width="100%" runat="server" Text='<%# Bind("FollowRemarks") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Done">
                                <ItemStyle HorizontalAlign="Center" Width="30px" />
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="chkDone" visible='<%# (Convert.ToInt32(Eval("FollowStatus")) == 0)? true: false  %>' Checked="false" />
                                </ItemTemplate>
                            </asp:TemplateField>

                             <asp:TemplateField HeaderText="Save">
                                <ItemStyle HorizontalAlign="Center" Width="100px" />
                                <HeaderStyle VerticalAlign="Middle" />
                                <ItemTemplate>
                                        <asp:Button ID="btn_Save" runat="server" Width="80px" Text="Done" BackColor="#1B7FC2"
                                        ForeColor="#FFFFFF" OnClick="btn_SaveClick"/>
                                </ItemTemplate>
                            </asp:TemplateField>

                        </Columns>
                        <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False"
                            Height="27px" VerticalAlign="Bottom" />
                    </asp:GridView>
                </div>
                <table width="100%" border="0">
                    <tr>
                        <td>
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 220px;">
                                    </td>
                                    <td>
                                        <asp:Label ID="lblError" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
